﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CDC.SampleShell.Presentation.Content
{
    /// <summary>
    /// Interaction logic for ExportTab.xaml
    /// </summary>
    public partial class ExportTab : UserControl
    {
        public ExportTab()
        {
            InitializeComponent();
        }

        private void FileButton_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog();
            saveFileDialog.AutoUpgradeEnabled = true;
            saveFileDialog.CheckFileExists = false;
            saveFileDialog.DefaultExt = "edp7";
            saveFileDialog.Filter = "Epi Info Data Package|*.edp7";

            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            System.Windows.Forms.DialogResult result = saveFileDialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                txtFilePath.Text = saveFileDialog.FileName;
            }
        }

        private void txtExportStatus_TextChanged(object sender, TextChangedEventArgs e)
        {
            txtExportStatus.ScrollToEnd();
        }
    }
}
